/**
  ******************************************************************************
  * @file 
  * @brief 
  * @author taoye
  * @version V1.0.0
  * @date 2021/01/01
  ******************************************************************************
  */
#ifndef _TCA9535_H
#define _TCA9535_H 

#include "dev_include.h"

/* private config -----------------------------------------------------------*/
typedef struct
{
    drv_i2c_t       i2c;
    drv_gpio_t      gpio_int;
}tca9535_private_t;

/* Public defines -----------------------------------------------------------*/
typedef struct dev_tca9535  dev_tca9535_t;

/* Public enum    -----------------------------------------------------------*/

typedef enum
{
    TCA9535_INPUT = 0,
    TCA9535_OUTPUT,
}tca9535_mode_e;


/* Public Struct  -----------------------------------------------------------*/
struct dev_tca9535
{
    /* ***************Public Parameter  *************** */
    const char *    PIN_SDA;
    const char *    PIN_SCL;
    const char *    PIN_INT;

    uint8_t         SLAVE_ADDR;
    bool        SAMPLE_DELAY;
    void         ( *Int_Callback )   (void);
    /* ***************Public Method     *************** */
    int     ( *Check     )   ( dev_tca9535_t * );
    void    ( *ModeSetBit)   ( dev_tca9535_t *, tca9535_mode_e,    uint16_t );
    void    ( *WriteBit  )   ( dev_tca9535_t *, uint8_t,           uint16_t );
    uint16_t ( *ReadData   )   ( dev_tca9535_t *);

    /* ***************Private Attributes*************** */
    tca9535_private_t  private;
};


/* Public Variable  ---------------------------------------------------------*/
//Pointer

//Array

//Const



/* Pubilc function prototypes -----------------------------------------------*/
int     Dev_Tca9535_Init    (dev_tca9535_t *this);
	
#endif

